package cn.djun.news.util;

import com.github.pagehelper.PageInfo;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author djun
 * @classname Paginating
 * @description
 * @date 2020/11/23 10:04
 * @email 3170495286@qq.com
 */
@Data
@NoArgsConstructor
public class Paginating<T> {
    /**
     * 每一页显示条数
      */
    private String limit;
    /**
     * 当前页数
     */
    private String page;
    /**
     * 总计页数
     */
    private String pages;
    /**
     * 数据总条数
     */
    private String total;
    /**
     * 数据
     */
    private List<T> list;
    public Paginating(PageInfo p){
        limit = p.getPageSize() + "";
        page = p.getPageNum() + "";
        pages = p.getPages() + "";
        total = p.getTotal() + "";
        this.list = p.getList();
    }
}